![]() |
YNQ
YNQ-1.5.2
|
Modules | |
| File attributes | |
| File access mode | |
| File share mode | |
| File locality | |
| File create action | |
| File open action | |
| File seek constants | |
Typedefs | |
| typedef void(* | CCServerSideCopyCallback )(NQ_STATUS status, NQ_UINT32 totalBytesWritten, NQ_UINT64 totalFileSize, void *context) |
Functions | |
| NQ_HANDLE | ccCreateFileA (const NQ_CHAR *fileName, NQ_INT access, NQ_INT shareMode, NQ_INT locality, NQ_BOOL writeThrough, NQ_UINT16 attributes, NQ_INT createAction, NQ_INT openAction) |
| NQ_HANDLE | ccCreateFile (const NQ_WCHAR *fileName, NQ_INT access, NQ_INT shareMode, NQ_INT locality, NQ_BOOL writeThrough, NQ_UINT16 attributes, NQ_INT createAction, NQ_INT openAction) |
| NQ_BOOL | ccDeleteFileA (const NQ_CHAR *fileName) |
| NQ_BOOL | ccDeleteFile (const NQ_WCHAR *fileName) |
| NQ_BOOL | ccMoveFileA (const NQ_CHAR *oldFilename, const NQ_CHAR *newFilename) |
| NQ_BOOL | ccMoveFile (const NQ_WCHAR *oldFilename, const NQ_WCHAR *newFilename) |
| NQ_BOOL | ccReadFile (NQ_HANDLE hndl, NQ_IOBufPos buffer, NQ_UINT count, NQ_UINT *readSize) |
| NQ_BOOL | ccReadFileAsync (NQ_HANDLE hndl, NQ_IOBufPos buffer, NQ_UINT count, void *context, void(*callback)(NQ_STATUS, NQ_UINT, void *)) |
| NQ_BOOL | ccWriteFile (NQ_HANDLE hndl, NQ_IOBufPos buffer, NQ_UINT count, NQ_UINT *writtenSize) |
| NQ_BOOL | ccWriteFileAsync (NQ_HANDLE hndl, NQ_IOBufPos buffer, NQ_UINT count, void *context, void(*callback)(NQ_STATUS, NQ_UINT, void *)) |
| NQ_BOOL | ccFlushFile (NQ_HANDLE handle) |
| NQ_BOOL | ccCloseHandle (NQ_HANDLE handle) |
| typedef void(* CCServerSideCopyCallback)(NQ_STATUS status, NQ_UINT32 totalBytesWritten, NQ_UINT64 totalFileSize, void *context) |
Prototype for a callback function for server side copy chunk response. This function is called after each response from the server arrives.
| status | The response status |
| totalBytesWritten | Total bytes that was written in the file |
| totalFileSize | Total file size |
| context | A context pointer supplied by the application. By using context, an application can distinguish between different copy chunk operations. |
| NQ_HANDLE ccCreateFileA | ( | const NQ_CHAR * | fileName, |
| NQ_INT | access, | ||
| NQ_INT | shareMode, | ||
| NQ_INT | locality, | ||
| NQ_BOOL | writeThrough, | ||
| NQ_UINT16 | attributes, | ||
| NQ_INT | createAction, | ||
| NQ_INT | openAction | ||
| ) |
This function is called by application to create or open a file.
| fileName | Path of the file to be created/opened. |
| access | Desired file access mode (see File access mode module). |
| shareMode | Desired file share mode (see File share mode module). |
| locality | Desired file locality (see File locality module). |
| writeThrough | If TRUE then no read ahead or write behind allowed on this file or device. When the response is returned, data is expected to be on the disk or device. |
| attributes | File attributes for a newly created file (see File attributes module) |
| createAction | Desired file create action (see File create action module). |
| openAction | Desired file open action (see File open action module). |
| NQ_HANDLE ccCreateFile | ( | const NQ_WCHAR * | fileName, |
| NQ_INT | access, | ||
| NQ_INT | shareMode, | ||
| NQ_INT | locality, | ||
| NQ_BOOL | writeThrough, | ||
| NQ_UINT16 | attributes, | ||
| NQ_INT | createAction, | ||
| NQ_INT | openAction | ||
| ) |
This function is called by application to create or open a file.
| fileName | Path of the file to be created/opened. |
| access | Desired file access mode (see File access mode module: FILE_AM_READ, FILE_AM_SPECIAL_MASK, FILE_AM_READ_WRITE, FILE_AM_WRITE). |
| shareMode | Desired file share mode (see File share mode module: FILE_SM_COMPAT, FILE_SM_DENY_NONE, FILE_SM_DENY_READ, FILE_SM_DENY_WRITE, FILE_SM_EXCLUSIVE). |
| locality | Desired file locality (see File locality module: FILE_LCL_MIXED, FILE_LCL_RANDOM, FILE_LCL_SEQUENTIAL, FILE_LCL_UNKNOWN). |
| writeThrough | If TRUE then no read ahead or write behind allowed on this file or device. When the response is returned, data is expected to be on the disk or device. |
| attributes | File attributes for a newly created file (see File attributes module: CIFS_ATTR_ALL, CIFS_ATTR_ARCHIVE, CIFS_ATTR_DIR, CIFS_ATTR_HIDDEN, CIFS_ATTR_READONLY, CIFS_ATTR_SYSTEM, CIFS_ATTR_VOLUME). |
| createAction | Desired file create action, can be one of the following values: FILE_CA_CREATE, FILE_CA_FAIL. |
| openAction | Desired file open action, can be one of the following values: FILE_OA_FAIL, FILE_OA_OPEN, FILE_OA_TRUNCATE. |
This function is called by application to delete a file.
| fileName | Path of the directory to be created |
This function is called by application to delete a file.
| fileName | Path of the directory to be created |
This function is called by application to move (rename) a file/directory to a different location. note, that a file cannot be moved between different remote shares.
| oldFilename | Path of the file/directory to be moved. |
| newFilename | Path of the file/directory to be moved to. |
This function is called by application to move (rename) a file/directory to a different location. note, that a file cannot be moved between different remote shares.
| oldFilename | Path of the file/directory to be moved. |
| newFilename | Path of the file/directory to be moved to. |
This function is called by application to read data from the opened file.
NQ attempts to use the biggest available payload. However, if the count parameter is big enough, calling this function results in transmitting multiple SMB requests. NQ Client attempts to send these requests concurrently. Since this call is synchronous, NQ will wait for all responses to come back from the server.
NQ Client reads file bytes from its current position. For random access, use function ccSetFilePointer().
| hndl | Handle value returned by calling ccCreateFile() |
| buffer | Pointer to a buffer to read the file data to |
| count | Number of bytes to read from the file |
| readSize | The pointer to a variable which on exit receives the number of bytes actually read. This value can be NULL. |
| NQ_BOOL ccReadFileAsync | ( | NQ_HANDLE | hndl, |
| NQ_IOBufPos | buffer, | ||
| NQ_UINT | count, | ||
| void * | context, | ||
| void(*)(NQ_STATUS, NQ_UINT, void *) | callback | ||
| ) |
This function is called by application to read data from the opened file.
NQ attempts to use the biggest available payload. However, if the count parameter is big enough, calling this function results in transmitting multiple SMB requests. NQ Client attempts to send these requests concurrently. Since this call is asynchronous, NQ will not wait for all responses to come back from the server but will rather call the callback function after receiving the last response.
NQ places the actual number of data read into the first argument of the call to the callback function.
NQ Client reads bytes starting from the current position in the file. For random read use function ccSetFilePointer().
This function is not thread-protected over the same file. It assumes that there is just one thread reading file through the given handle. Otherwise, the result is undefined. It is possible, however, to read the same file over two different handles simultaneously.
| hndl | Handle value returned by calling ccCreateFile(). |
| buffer | Pointer to a buffer to use for reading. |
| count | Number of bytes to write to the file. |
| context | A context pointer supplied by the application. By using context, an application can distinguish between different write operations. For casting purposes first structure field must be of type NQ_BOOL representing whether response is postponed by the server, used internally by NQ Client. |
| callback | Pointer to a callback function supplied by application. This function accepts operation status, the actual number of bytes read and an abstract context pointer supplied by the application. |
The application can inspect the error code for the failure reason.
Because of the asynchronous character of this operation the value does not reflect read results.
Application should use callback to analyze read results.
This function is called by application to write data to an open file.
Upon successful completion NQ places the actual number of data written into the memory location pointed by parameter writtenSize. On an error, this value is left unmodified.
NQ Client writes bytes starting from the current position in the file. For random write use function ccSetFilePointer().
The ccWriteFile() function can be also called for file truncation. Use ccSetFilePointer() function first to set file pointer into the desired end-of-file position. Then call the current function with zero data size. This will truncate the file.
| hndl | Handle value returned by calling ccCreateFile(). |
| buffer | Pointer to a buffer with bytes to be written. |
| count | Number of bytes to write to the file. |
| writtenSize | Pointer to a variable which will receive the number of bytes actually written. This value can be NULL. |
| NQ_BOOL ccWriteFileAsync | ( | NQ_HANDLE | hndl, |
| NQ_IOBufPos | buffer, | ||
| NQ_UINT | count, | ||
| void * | context, | ||
| void(*)(NQ_STATUS, NQ_UINT, void *) | callback | ||
| ) |
This function is called by application to write data to an open file using asynchronous operations.
Upon successful completion NQ schedules necessary write operations. When all writes will be complete, NQ will call the callback function.
When calling the callback function, NQ places the actual number of data written into the first argument of this call.
NQ Client writes bytes starting from the current position in the file. For random write use function ccSetFilePointer().
The ccWriteFile() function can be also called for file truncation. Use ccSetFilePointer() function first to set file pointer into the desired end-of-file position. Then call the current function with zero data size. This will truncate the file.
This function is not thread-protected over the same file. It assumes that there is just one thread writing to the file through the given handle. Otherwise, the result is undefined. It is possible, however, to write the same file over two different handles simultaneously. The permission to open the same file twice for read depends on the server's policies.
| hndl | Handle value returned by calling ccCreateFile(). |
| buffer | Pointer to a buffer with bytes to be written. |
| count | Number of bytes to write to the file. |
| context | A context pointer supplied by the application. By using context, an application can distinguish between different write operations. |
| callback | Pointer to a callback function supplied by application. This function accepts the actual number of bytes written and an abstract context pointer supplied by the application. For casting purposes first structure field must be of type NQ_BOOL representing whether response is postponed by the server, used internally by NQ Client. |
Because of the asynchronous character of this operation the value does not reflect write results. Application should use callback to analyze write results.
This function is called by application to force server to synchronize its local buffers with the file contents.
| handle | Handle value returned by calling ccCreateFile() |
This function is called by application to close the file handle
| handle | Handle value returned by calling ccCreateFile() |